import i18n from '@/locales/index'
const { t } = i18n.global

export const columns =  [
  {
    title18: 'common.sequenceNo', dataIndex: 'index', key: 'index', align: 'center', width: 60,
    customRender: ({ index }) => {
      return index + 1
    }
  },
  { title18: 'deviceManage.equipmentCode', dataIndex: 'code', key: 'code', align: 'center', width: 130, sorter: true },
  { title18: 'deviceManage.equipmentName', dataIndex: 'name', key: 'name', align: 'center', width: 130  },
  { title18: 'deviceManage.LoginStation', dataIndex: 'loginStation', key: 'loginStation', align: 'center', width: 130  },
  { title18: 'common.state', dataIndex: 'loginStatus', key: 'loginStatus', align: 'center', width: 130, sorter: true },
  // { title: t('deviceManage.ipAddr'), dataIndex: 'ipAddr', key: 'ipAddr', align: 'center', width: 130 },
  { title18: 'deviceManage.macAddr', dataIndex: 'macAddr', key: 'macAddr', align: 'center', width: 130, sorter: true },
  { title18: 'common.startState', dataIndex: 'status', key: 'status', align: 'center', width: 130 },
  { title18: 'common.operate', dataIndex: 'operate', key: 'operate', align: 'center', width: 130, fixed: 'right' },
] 

export const modalRules = {
  name: [{ required: true, message: t('deviceManage.pleaseInputEquipmentName') }],
  macAddr: [{ required: true, message: t('deviceManage.pleaseInputMac') }],
  status: [{ required: true, message: t('common.pleaseSelectStartState') }]
}